﻿using cludg.Domain.Environment;
using cludg.Domain.Users;
using FluentNHibernate.Mapping;

namespace cludg.Repository.NHibernate.Config.Environment
{
	public class HistoryEntryMap : ClassMap<HistoryEntry>
	{
		public HistoryEntryMap()
		{
			Table("History");
			Not.LazyLoad();
			Cache.ReadWrite();
			Id(x => x.Id).Length(50)
				.GeneratedBy.Custom<Utils.IdentifierGenerator>()
				.Default("");
			Map(x => x.ObjectId)
				.Length(50);
			Map(x => x.Date);
			Map(x => x.Type);
			References(x => x.User)
				.Column("UserId")
				.LazyLoad()
				.Nullable();
		}
	}
}
